package com.hailiao.beidou.message.utils

import android.os.Build

/**
 * 权限工具类
 * @Author d10ng
 * @Date 2024/3/5 13:59
 */

// 定位权限列表
val locationPermissionArray = arrayOf(
    android.Manifest.permission.ACCESS_COARSE_LOCATION,
    android.Manifest.permission.ACCESS_FINE_LOCATION
)

// 后台定位权限，需要在获取到基础定位权限后才能获取
val backgroundLocationPermissionArray = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
    arrayOf(
        android.Manifest.permission.ACCESS_BACKGROUND_LOCATION
    )
} else arrayOf()

// 蓝牙权限
val bluetoothPermissionArray = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
    arrayOf(
        android.Manifest.permission.BLUETOOTH,
        android.Manifest.permission.BLUETOOTH_ADMIN,
        android.Manifest.permission.BLUETOOTH_SCAN,
        android.Manifest.permission.BLUETOOTH_CONNECT
    )
} else {
    arrayOf(
        android.Manifest.permission.BLUETOOTH,
        android.Manifest.permission.BLUETOOTH_ADMIN
    )
}

// 前台服务
val foregroundServicePermissionArray = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
    arrayOf(
        android.Manifest.permission.FOREGROUND_SERVICE
    )
} else arrayOf()

// 读写权限
val storagePermissionArray = arrayOf(
    android.Manifest.permission.READ_EXTERNAL_STORAGE,
    android.Manifest.permission.WRITE_EXTERNAL_STORAGE
)